package sk.hackcraft.util.generator.empirical;

public class DiscreteEmpiricalBuilderItem extends AbstractBuilderItem
{
	private final DiscreteEmpiricalBuilder builder;
	
	public DiscreteEmpiricalBuilderItem(double probability, DiscreteEmpiricalBuilder builder)
	{
		super(probability);
		this.builder = builder;
	}
	
	@Override
	public EmpiricalItemCreatorDelegate getEmpiricalItemCreatorDelegate()
	{
		return new EmpiricalItemCreatorDelegate()
		{
			@Override
			public EmpiricalItem createEmpiricalItem(double cumulativeValue)
			{
				return new EmpiricalItem(cumulativeValue, new DiscreteEmpiricalRandom(builder));
			}
		};
	}
}
